home *** CD-ROM | disk | FTP | other *** search
- // msgtst.cpp: This program demonstrates how you can create a simple
- // dialog box--like those in QP--that displays help messages
-
- #include "dialogue.h"
-
- void PopupMsg(char *Str, MsgPkt &M)
- // Popup a dialog box
- {
- MsgBox *MB;
-
- MB = new MsgBox(Str, 0x11, WindowStyle-BorderPrompt, InvColors);
- MB->Open(FullScrn, (80-MB->Panel->Overall->Wd) / 2,
- (25-MB->Panel->Overall->Ht) / 2);
- MB->SwitchFocus(M);
- M.RtnCode = Idle; M.Code = Idle;
- do {
- MB->SubMgr->EventStep(M);
- M.Code = M.RtnCode;
- } while (M.Code != ShutDown &&
- (!MB->Active || M.Code != Close || M.Focus != (Iso *)MB));
- if (M.Code == Close) {
- MB->OnClose(M);
- M.RtnCode = Idle;
- }
- delete MB;
- }
-
- Wso *W;
-
- main()
- {
- Setup(MouseOptional, CyanColors);
- FullScrn->Panel->Clear(177, 0x07);
- W = new Wso(0x11, WindowStyle, CyanColors);
- W->SetSize(70,18);
- W->Open(FullScrn,2,2);
- PopupMsg("This is a test of the MsgBox type",StartMsg);
- CleanUp();
- }
-
-